﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace QLCHHoaLan
{
    public partial class FrmTimKiemKhachHang : Form
    {
        public FrmTimKiemKhachHang()
        {
            InitializeComponent();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            Menu main = new Menu();
            main.kq = 1;
            main.Show();
            this.Hide();
        }

        private void btnTim_Click(object sender, EventArgs e)
        {
            if (txtHoTen.Text == "" && txtSoDienThoai.Text == "")
            {
                MessageBox.Show("Chưa nhập tên hoặc số điện thoại", "Thông Báo", MessageBoxButtons.OK);
            }
            else
            {
                KhachHangDTO khdto = new KhachHangDTO();
                string hoTen = txtHoTen.Text;
                string sDT = txtSoDienThoai.Text;

                KhachHangBUS khbus = new KhachHangBUS();
                DataTable dt = new DataTable();

                dt = khbus.TimKiemKH(hoTen, sDT);
                dgvTimKiemKhachHang.DataSource = dt;
            }
        }

        private void btnRefresh_Click(object sender, EventArgs e)
        {
            txtHoTen.Text = null;
            txtSoDienThoai.Text = null;
        }

      
    }
}
